'use strict'
const Koa=require('koa');
const bodyparser=require('koa-bodyparser');
const cors=require('koa-cors');
const {Blog,sync}=require('./model');
sync().then(()=>{
    Blog.bulkCreate([
        {
            title:'的1',
            digest:'默默',
            content:'dfff',
            classify:'dd',
            author:'f',
            timedate:'22'
        },
        {
            title:'的2',
            digest:'默默',
            content:'dfff',
            classify:'dd',
            author:'f',
            timedate:'22'
        },
        {
            title:'的3',
            digest:'默默',
            content:'dfff',
            classify:'dd',
            author:'f',
            timedate:'22'
        },
        {
            title:'的4',
            digest:'默默',
            content:'dfff',
            classify:'dd',
            author:'f',
            timedate:'22'
        },
    ]);
}

);
//const routerMil=require('./router/index');
let app=new Koa();
app.use(bodyparser())
app.use(cors())
//app.use(routerMil())
let port=9090;
app.listen(port);
console.log(`http://localhost:${port}`);